#include "Vector3.h"

Vector3::Vector3()
{
  x=0;
  y=0;
  z=0;
}

Vector3::~Vector3()
{

}

double Vector3::getX()
{
  return x;
}

double Vector3::getY()
{
  return y;
}

double Vector3::getZ()
{
  return z;
}

void Vector3::setX(double newx)
{
  x=newx;
}

void Vector3::setY(double newy)
{
  y=newy;
}

void Vector3::setZ(double newz)
{
  z=newz;
}

void Vector3::setVector(double newx,double newy,double newz)
{
  x=newx;
  y=newy;
  z=newz;
}

void Vector3::add(Vector3 vec)
{
  x+=vec.x;
  y+=vec.y;
  z+=vec.z;
}

double Vector3::dotProduct(Vector3 vec)
{
  return (x*vec.x+y*vec.y+z*vec.z);
}

void Vector3::crossProduct(Vector3 vec)
{
  double newx=y*vec.z-z*vec.y;
  double newy=z*vec.x-x*vec.z;
  double newz=x*vec.y-y*vec.x;
  x=newx;
  y=newy;
  z=newz;
}

void Vector3::mult(double number)
{
  x=x*number;
  y=y*number;
  z=z*number;
}

void Vector3::copy(Vector3 vec)
{
  x=vec.getX();
  y=vec.getY();
  z=vec.getZ();
}
